Skip to content

fix flaky fix-test_streamablehttp_client_resumption test #1166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 17, 2025

Conversation

ihrpr
Copy link
Contributor

@ihrpr ihrpr commented Jul 17, 2025

While fixing the test found an bug, we should not check for fix-test_streamablehttp_client_resumption when setting as it's used for reusability and the check is done afterwards in the code anyways.

@ihrpr ihrpr requested a review from felixweinberger July 17, 2025 15:48
@ihrpr ihrpr marked this pull request as draft July 17, 2025 15:53
@ihrpr ihrpr marked this pull request as ready for review July 17, 2025 16:04
Comment on lines +228 to +260
elif name == "wait_for_lock_with_notification":
# Initialize lock if not already done
if self._lock is None:
self._lock = anyio.Event()

# First send a notification
await ctx.session.send_log_message(
level="info",
data="First notification before lock",
logger="lock_tool",
related_request_id=ctx.request_id,
)

# Now wait for the lock to be released
await self._lock.wait()

# Send second notification after lock is released
await ctx.session.send_log_message(
level="info",
data="Second notification after lock",
logger="lock_tool",
related_request_id=ctx.request_id,
)

return [TextContent(type="text", text="Completed")]

elif name == "release_lock":
assert self._lock is not None, "Lock must be initialized before releasing"

# Release the lock
self._lock.set()
return [TextContent(type="text", text="Lock released")]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really cool idea to have the tool calls create internal locks for this!

@ihrpr ihrpr merged commit 813da6a into main Jul 17, 2025
13 checks passed
@ihrpr ihrpr deleted the ihrpr/fix-test_streamablehttp_client_resumption branch July 17, 2025 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants